<!-- View -->
<script type="text/javascript" src="<?php echo $img_url; ?>style/js/FE/customs.js"></script>

<div id="detail-title">
    <span class="title"><?php echo $page_title; ?></span>
    <img src="<?php echo $img_url; ?>style/images/img28.gif">
    <div class="ico-social">
        <a href="https://www.facebook.com/sharer/sharer.php?u=<?php echo $current_url; ?>&display=popup&ref=plugin" target="_blank"><img src="<?php echo $img_url; ?>style/images/imgfb.gif" width="16" height="16" border="0"></a>
        <a href="https://twitter.com/share" target="_blank"><img src="<?php echo $img_url; ?>style/images/imgtw.gif" width="16" height="16" border="0"></a>
        <a href="https://plus.google.com/share?url=<?php echo $current_url; ?>" target="_blank"><img src="<?php echo $img_url; ?>style/images/imggp.gif" width="16" height="16" border="0"></a>
        <a href="javascript:void(0);" onclick="return openPopup('contactForm')"><img src="<?php echo $img_url; ?>style/images/imgma.gif" width="16" height="16" border="0"></a>
        <a href="javascript:void(0);" onclick="javascript:window.print();"><img src="<?php echo $img_url; ?>style/images/imgpr.gif" width="16" height="16" border="0"></a>

        <span class="time">
            <?php
            //show date time Tieng Viet
            $str_search = array(
                "Mon",
                "Tue",
                "Wed",
                "Thu",
                "Fri",
                "Sat",
                "Sun"
            );
            $str_replace = array(
                "Th&#7913; hai",
                "Th&#7913; ba",
                "Th&#7913; t&#432;",
                "Th&#7913; n&#259;m",
                "Th&#7913; s&#225;u",
                "Th&#7913; b&#7843;y",
                "Ch&#7911; nh&#7853;t"
            );
            $timenow = gmdate("D, d/m/Y | H:i", time() + 7 * 3600);
            $timenow = str_replace($str_search, $str_replace, $timenow);
            echo $timenow;
            ?>      
        </span>
    </div>
</div>  
<div id="seperator"></div>
<!-- details: column -->
<div id="detail-body">
    <form method="get" id="formCustoms">
        <input type="text" value="<?php if(isset($_GET["txtSearch"])) echo $_GET["txtSearch"]; ?>" id="txtSearch" name="txtSearch" placeholder="Nhập thủ tục cần tìm">
        <input type="text" value="" id="txtCustomsCate" name="txtCustomsCate" placeholder="Nhóm thủ tục" onclick="Customs.toogleCate();" readonly>
        <img src="<?php echo $img_url; ?>style/img/showmore.png" class="buttonShowMore" onclick="Customs.toogleCate();" />
        <input type="button" value="Tìm kiếm" id="btnCustomsSearch" onclick="Customs.customsSearch();" />
        <input type="hidden" id="cateValue" value="<?php if(isset($_GET["txtCustomsCate"])) echo $_GET["txtCustomsCate"]; ?>" />
    </form>
    <div class="clearfix"></div>
    <div id="customs-body">  
        <?php
        if(sizeof($listCustoms) > 0){
        ?>
        <table id="listCustoms" border="0" cellspacing="0" cellpadding="0">
            <tr class="tableHeader">
                <td class="thSTT">STT</td>
                <td class="thName">Tên thủ tục</td>
                <td class="thCate">Nhóm thủ tục</td>
            </tr>
            <?php 
            foreach ($listCustoms as $key => $value): 
            ?>
            <tr>
                <td class="tdSTT"><?php echo $key + ($currentPage-1)*10 + 1; ?></td>
                <td><a href="/thu-tuc-hai-quan/<?php echo $value->customs_url . '-' . $value->customs_id; ?>"><?php echo $value->customs_name; ?></a></td>
                <td>
                    <?php 
                    foreach ($cate_customs as $cate_value) {
                        if($cate_value->cate_id == $value->customs_cate){
                            echo $cate_value->cate_name;
                            break;
                        }
                    }
                    ?>
                </td>
            </tr>   
            <?php endforeach ?>
        </table>
        <div id="customs-paging">
            <?php echo $paging; ?>
        </div>
        <?php
        }
        else{
        ?>
            <div id="nodata">Không có dữ liệu tồn tại</div>
        <?php
        }
        ?>
    </div>
</div>  
<div id="customs_cate">
    <div class="header">
        <div class="title">Chọn nhóm thủ tục</div>
        <img src="<?php echo $img_url; ?>style/img/close.png" onclick="Customs.closeCate();" />
        <div class="clearfix"></div>
    </div>
    <div class="deleteAll">
        <a href="javascript:;" onclick="Customs.deleteAllCate();">Xóa tất cả các lựa chọn</a>
    </div>
    <div class="body">
        <?php
        $itemPerColumn = sizeof($cate_customs) / 2;

        for($k=0; $k<2; $k++){
            if($k == 0){
                ?>
                <ul class="cate_content">
                <?php
            }
            else{
                ?>
                <ul class="cate_content column2">
                <?php
            }
            for($i=0; $i<$itemPerColumn; $i++){
                $indexCate = $itemPerColumn * $k + $i;
                ?>
                <li><input type="checkbox" value="<?php echo $cate_customs[$indexCate]->cate_id; ?>" />&nbsp;<label onclick="Customs.checkCate('<?php echo $cate_customs[$indexCate]->cate_id; ?>');" id="labelCate_<?php echo $cate_customs[$indexCate]->cate_id; ?>"><?php echo $cate_customs[$indexCate]->cate_name; ?></a></li>
                <?php
            }
            ?>
                </ul>
            <?php
        }
        ?>
        <div class="clearfix"></div>
    </div>
</div>

